﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

namespace PR.UI.Web.RamanSyrtsou
{
    public class EnumerationsProvider
    {
        public List<KeyValuePair<int, string>> Categories;
        public List<KeyValuePair<int, string>> Types;

        private static EnumerationsProvider instance;
        private static object locker = new object();

        private EnumerationsProvider()
        {
            var service = new WebServiceClientRamanSyrtsou();
            Categories = service.GetAllSupportedCategories();
            Types = service.GetAllSupportedTypes();
        }

        public static EnumerationsProvider Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (locker)
                    {
                        if (instance == null)
                        {
                            instance = new EnumerationsProvider();
                        }
                    }
                }

                return instance;
            }
        }
    }
}
